﻿using HttpApiGateway.Collect;
using HttpApiGateway.FileUp.Interface;
using HttpApiGateway.FileUp.Model;
using RpcHelper.Validate;
namespace HttpApiGateway.Api
{
    internal class BlockUpController : ApiController
    {
        public BlockUpSate GetState([NullValidate("gateway.http.up.taskId.error")] string taskId)
        {
            if (BlockUpCollect.GetTask(taskId, out IBlockUpTask task))
            {
                return task.GetUpState();
            }
            throw new RpcHelper.ErrorException("gateway.http.up.task.not.find");
        }
    }
}
